<?php

namespace app\store\validate;

use think\Validate;

class PaymentConfigValidate extends Validate
{
    protected $rule = [
        'sort' => 'require|>=:0',
        'type' => 'in:1,2,3',
        'status' => 'require|in:0,1'
    ];


    protected $message = [
        'id.require' => '非法请求',
        'id.integer' => '非法请求',
        'sort.require' => '排序不能为空',
        'status.in' => '无效的状态值!',
        'type.in' => '无效的支付类型值!',
    ];


    public function sceneSwitch()
    {
        return $this->only(['id','status'])
                    ->append('id', 'require|integer');
    }

    public function sceneEdit()
    {
    	return $this->only(['id','sort','type','status'])
                    ->append('id', 'require|integer');
            
    }   
}